/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author wan.fairul
 */
@Entity
@Table(name = "personal_task")
@NamedQueries({
    @NamedQuery(name = "PersonalTask.findAll", query = "SELECT p FROM PersonalTask p")})
public class PersonalTask implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "personal_task_id")
    private Integer personalTaskId;
    @Column(name = "to_user")
    private String toUser;    
    @Column(name = "subject")
    private String subject;
    @Column(name = "status_remarks")
    private String statusRemarks;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "priority_code_id")
    private PriorityCode priorityCode;
    @Column(name = "priority_day_count")
    private Integer priorityDayCount;
    @Column(name = "due_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date duedate;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "assignee_user_id")
    private User assignee;
    @Column(name = "acquired_sts")
    private String acquiredSts;
    @Column(name = "flag")
    private Integer flag;
    @Column(name = "deduce_point")
    private Integer deducePoint;
    @Embedded
    private InfoAudit infoAudit;

    

    public PersonalTask() {
    }

    public PersonalTask(Integer personalTaskId) {
        this.personalTaskId = personalTaskId;
    }

    public Integer getPersonalTaskId() {
        return personalTaskId;
    }

    public void setPersonalTaskId(Integer personalTaskId) {
        this.personalTaskId = personalTaskId;
    }

    public String getToUser() {
        return toUser;
    }

    public void setToUser(String toUser) {
        this.toUser = toUser;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }


    public String getStatusRemarks() {
        return statusRemarks;
    }

    public void setStatusRemarks(String statusRemarks) {
        this.statusRemarks = statusRemarks;
    }

   
    public PriorityCode getPriorityCode() {
        return priorityCode;
    }

    public void setPriorityCode(PriorityCode priorityCode) {
        this.priorityCode = priorityCode;
    }

    public Integer getPriorityDayCount() {
        return priorityDayCount;
    }

    public void setPriorityDayCount(Integer priorityDayCount) {
        this.priorityDayCount = priorityDayCount;
    }

    public User getAssignee() {
        return assignee;
    }

    public void setAssignee(User assignee) {
        this.assignee = assignee;
    }

    public String getAcquiredSts() {
        return acquiredSts;
    }

    public void setAcquiredSts(String acquiredSts) {
        this.acquiredSts = acquiredSts;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    public Date getDuedate() {
        return duedate;
    }

    public void setDuedate(Date duedate) {
        this.duedate = duedate;
    }

    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }   

    public Integer getDeducePoint() {
        return deducePoint;
    }

    public void setDeducePoint(Integer deducePoint) {
        this.deducePoint = deducePoint;
    }
      
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (personalTaskId != null ? personalTaskId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonalTask)) {
            return false;
        }
        PersonalTask other = (PersonalTask) object;
        if ((this.personalTaskId == null && other.personalTaskId != null) || (this.personalTaskId != null && !this.personalTaskId.equals(other.personalTaskId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.PersonalTask[ personalTaskId=" + personalTaskId + " ]";
    }
}
